string_mid
This function returns a specified number of characters from any given position of a string.
string string_mid(string the_string, uint start_position, uint count)
Parameters:
the_string
The string that will be extracted from.
start_position
The position to start extracting from.
count
The number of characters to return.
Return value:
The extracted string.
Remarks:
If the count is less than 1, a blank string will be returned, regardless of the position value.
If the count is greater than the length of the string minus the start position, the remainder of the string is returned.
If start_position is less than 1, the function will extract from the left hand side of the string.
If start_position is greater than the length of the string, a blank string is returned.
Example:
void main()
{
alert("string_mid test", string_mid("Hello, I am here to test the string_mid function!", 30, 10)); //output should be string_mid
}